package jp.sourceforge.akjrcp.ui.param;


import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Composite;

public abstract class AbstractParamItem  implements ParamItem{
protected ParamItemActionListener paramActionListener;
protected ParamItem self;

public static final int LAYOUT_FILL_BOTH=-1;
public static final int LAYOUT_FILL_HORIZONTAL=0;
	public AbstractParamItem() {
	self=this;
}

	public void setParamItemActionListener(ParamItemActionListener listener) {
		this.paramActionListener=listener;
	}


	protected class ModifiCheck implements ModifyListener{

		public void modifyText(ModifyEvent e) {
			if(paramActionListener!=null){
				paramActionListener.paramItemModified(self);
			}
		}
		
	}

	public class SelectionCheck implements SelectionListener{

		public void widgetDefaultSelected(SelectionEvent e) {
			if(paramActionListener!=null){
				paramActionListener.paramItemModified(self);
			}
		}

		public void widgetSelected(SelectionEvent e) {
			if(paramActionListener!=null){
				paramActionListener.paramItemModified(self);
			}
		}
		
	}
}
